// https://www.cnblogs.com/sdflysha/p/20200109-sdmap-introduction.html
using DapperDemo.Infrastructure;
using sdmap.ext.Dapper;

var builder = WebApplication.CreateBuilder(args);
builder.Services.AddControllers();
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
builder.Services.AddScoped<IBaseRepository, BaseRepository>();
DbConnectionExtensions.SetEmbeddedSqlAssembly(typeof(IBaseRepository).Assembly);

var app = builder.Build();
app.UseSwagger();
app.UseSwaggerUI();
app.UseHttpsRedirection();
app.UseAuthorization();
app.MapControllers();
app.Run();